class_name PlayerStateMachine
extends StateMachine


func _init(init_owner: Variant) -> void:
	super("player")
	owner = init_owner


func _on_setup() -> void:
	add_state(PlayerGroundState.new())
	add_state(PlayerAirState.new())
	
	add_transition("any", MultiwayStateTransition.new(
		"root_transition",
		[
			func():\
				return 0 if owner.is_on_floor() else\
					   1
		],
		{
			[0]: "ground",
			[1]: "air",
		}
	))
